Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update handling for bools and enums with database defaults #30843

Merged
merged 3 commits into from
May 9, 2023

Conversation

ajcvickers
Copy link
Member

Fixes #15070

  • Warn for enums like we do for bools
  • Don't warn if a sentinel value has been configured
  • Update warning message to mention sentinel value
  • Set the sentinel by convention for non-nullable bools with a default value

@ajcvickers ajcvickers requested a review from a team May 8, 2023 12:09
== typeof(bool)
&& Equals(true, property.GetDefaultValue()))
{
propertyBuilder.HasSentinel(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should only set the sentinel when annotation is not null and reset it when it is.

Fixes #15070

- Warn for enums like we do for bools
- Don't warn if a sentinel value has been configured
- Update warning message to mention sentinel value
- Set the sentinel by convention for non-nullable bools with a default value
@ajcvickers ajcvickers force-pushed the TrueIsFalseAndFalseIsTrue0506 branch from c7dcdfa to f9bafb9 Compare May 9, 2023 08:28
@ajcvickers ajcvickers merged commit c63634b into main May 9, 2023
@ajcvickers ajcvickers deleted the TrueIsFalseAndFalseIsTrue0506 branch May 9, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update handling of non-nullable store-generated properties
2 participants